home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Icon 8.1 / mem / MPW Helpers / Menus / UserStartup•IconMenu < prev   
Encoding:
Text File  |  1992-11-08  |  2.1 KB  |  64 lines  |  [TEXT/MPS ]

  1. #
  2. #  MPW Startup Command Script to set up Macintosh MPW Icon
  3. #  special menus.
  4. #
  5. #    Author: Bob Alexander
  6. #
  7. Set IconMenu 'Icon'    # Define menu in which to put icon menu items.
  8. #AddMenu "{IconMenu}" '(-' '' # Use this separator if not first item of menu.
  9. #
  10. #  Do Icon  -- Evaluates the Icon expressions(s) or complete program
  11. #  selected in the active window.  Of nothing is selected, the line
  12. #  containing the insertion point is evaluated (just like "Enter").
  13. #
  14. AddMenu Icon '/IDo Icon' 'CopyExec "{Active}" | DoIcon'
  15. #
  16. #  Write Empty Procedure -- Writes an empty "procedure main()" shell
  17. #  into the active window.
  18. #
  19. AddMenu "{IconMenu}" 'Write Empty Procedure' ∂
  20.     'Echo "procedure main()"; ∂
  21.     Echo "  "; ∂
  22.     Echo "end"; ∂
  23.     Find §¡5 "{Active}"'
  24. #
  25. #  Find Undeclared -- Lists the undeclared identifiers in the selected
  26. #  Icon program text, or in the whole active window if the selection is
  27. #  empty.  Helpful in creating "local" declarations.
  28. #
  29. AddMenu "{IconMenu}" 'List Undeclared' ∂
  30.     'If `Count -c "{Active}.§"` == 0; ∂
  31.     Locals "{Active}"; ∂
  32.     Else; ∂
  33.     Locals "{Active}.§"; ∂
  34.     End'
  35. #
  36. #  Show ucode -- Displays the ucode generated by the Icon translator for
  37. #  the selected Icon program text.  (Ucode is in human-readable text
  38. #  format -- it can be interesting to see what kind of code is generated
  39. #  by various source code constructs.
  40. #
  41. AddMenu "{IconMenu}" 'Show ucode' ∂
  42.     'icont -s -c - < "{Active}.§"; ∂
  43.     Catenate stdin.u1; ∂
  44.     Echo '============================='; ∂
  45.     Catenate stdin.u2; ∂
  46.     Delete stdin.u?'
  47. #
  48. #  Mark Icon Procedures -- Creates Mark menu items for each procedure,
  49. #  global, link, and record declaration line in the Icon program in the
  50. #  active window.
  51. #
  52. AddMenu "{IconMenu}" 'Mark Icon Procedures' 'MarkIcon "{Active}"'
  53.  
  54. #
  55. #  Encomment or decomment the selected code.
  56. #
  57. AddMenu "{IconMenu}" 'Encomment' 'icom < "{Active}".§ | catenate > "{active}".§'
  58. AddMenu "{IconMenu}" 'Decomment' 'icom -d < "{Active}".§ | catenate > "{active}".§'
  59.  
  60. AddMenu "{IconMenu}" 'Output option...' 'Execute SetIconSpeed'
  61. AddMenu "{IconMenu}" 'Trace option...' 'Execute SetIconTrace'
  62.  
  63. Unset IconMenu
  64.